package com.learnspringcloud.order.utils;

import com.fasterxml.jackson.databind.ObjectMapper;

import java.io.IOException;

/**
 * @author Lin
 * @date 2018/11/23 0023
 */
public class JsonUtil {
    private static ObjectMapper objectMapper = new ObjectMapper();

    public static Object fromJson(String string, Class classType) {
        try {
            return objectMapper.readValue(string, classType);
        } catch (IOException e) {
            e.printStackTrace();
        }

        return null;
    }
}
